package com.lkl.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class AddressVO extends Address{

    @JSONField(ordinal = 3)
    private List<AddressVO> children;

    public List<AddressVO> getChildren() {
        return children;
    }

    public void setChildren(List<AddressVO> children) {
        this.children = children;
    }

    public AddressVO(String code, String name, String parentCode) {
        this.setCode(code);
        this.setName(name);
        this.setParentCode(parentCode);
    }

    public AddressVO() {
    }

    @Override
    public String toString() {
        return "code=" + getCode() + ", name=" + getName() + ", parentCode=" + getParentCode() +  ")";
    }
}
